package com.example.hybridmobiledemo.module.main.model.hospital;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.OrientationHelper;
import androidx.recyclerview.widget.RecyclerView;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.example.hybridmobiledemo.R;
import com.example.hybridmobiledemo.module.main.model.hospital.bean.Registering;
import com.example.hybridmobiledemo.view.MedicalAdapter;

import java.util.ArrayList;
import java.util.List;

public class Medical extends AppCompatActivity {
    private TextView backMedical;
    private RecyclerView medicalRV;
    private List<Registering> list = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_medical);
        initView();
        initData();

        backMedical.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    private void initData() {
        for (int i = 0; i < 8; i++) {
            String a = String.valueOf(i);
            list.add(new Registering(a,"北京协会医院","中医内科","内科门诊"));
        }

    }

    @SuppressLint("WrongConstant")
    private void initView() {
        backMedical = (TextView) findViewById(R.id.back_medical);
        medicalRV = (RecyclerView) findViewById(R.id.medical_RV);
        medicalRV.setAdapter(new MedicalAdapter(this,list));
        medicalRV.setLayoutManager(new LinearLayoutManager(this, OrientationHelper.VERTICAL,false));
    }
}